<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>过渡效果</title>
    <link rel="stylesheet" href="bootstrap.min.css"/>
    <style>
        #mydiv{
            width: 100px;
            height: 100px;
            background: red;
            transition:width 2s;
            -webkit-transition:width 2s;
        }

        #mydiv:hover{
            width: 400px;
        }
    </style>
</head>
<body>
    <div id="mydiv"></div>
    <script>
        document.getElementById("mydiv").addEventListener("transitionend",function(){
            this.innerHTML = "过渡事件触发--过渡已完成";
        })
    </script>
</body>
</html>